import http from '@/utils/http';

const urlMap = {
    // 接口调用情况分析
    apicallanalysisColumn: '/cloud/new/analysis/interfaceAnalysis',
    // 对话流程分析
    dialogueAnalysisColumn: '/cloud/new/analysis/dialogAnalysis',
    // 知识点数量分析
    knowledgeAnalysisColumn: '/cloud/new/data/getKnowledgeAnalysis',
    // 多轮对话总体情况分析
    mulDialogueAnalysisColumn: '/cloud/new/analysis/multiTerm',
    // 多轮对话完成率分析
    dialogueRateAnalysisColumn: '/cloud/new/data/getKnowledgeAnalysis',
    // 多轮对话平均轮数分析
    dialogueAveAnalysisColumn: '/cloud/new/data/getKnowledgeAnalysis',
    // 多轮对话失败原因分析
    dialogueFailAnalysisColumn: '/cloud/new/analysis/multiTermFail',
    // 问答任务情况分析
    questionAnalysisColumn: '/cloud/new/data/getQAndAanalysis',
    // 未知问题分析
    unKnownQuestionAnalysisColumn: '/cloud/new/data/unknownAnalysisList',
    // 未知问题知识点聚合
    unKnownQuestionAggColumn: '/cloud/new/data/unknownAggAnalysis',
}

const exportUrl = {
    mulDialogueAnalysisColumn: '/cloud/new/analysis/multiTermExport',
    questionAnalysisColumn: '/cloud/new/data/exportQAndATaskAnalysis'
}

// 机器人总览
export async function getData(params) {
    return http.post('/cloud/new/data/getOverviewByRobot', params);
}


// 获取Api调用表格数据
export async function getTableData(params) {
    let url = urlMap[params.type];
    delete params.type
    return http.post(url, params);
}

//excel导出Api调用表格
export async function downloadExcel(params) {
    let url = exportUrl[params.type];
    delete params.type
    return http.downloadExcel(url, params);
}